Skip to content

Add support for route-specific body limits in Fastify plugins#78

Merged
mitchknife merged 2 commits intomasterfrom
mitch/fastify-bodylimit
Apr 23, 2026
Merged

Add support for route-specific body limits in Fastify plugins#78
mitchknife merged 2 commits intomasterfrom
mitch/fastify-bodylimit

Conversation

@mitchknife
Copy link
Copy Markdown
Contributor

Summary

This change adds limited per-route Fastify configuration support to generated plugins, starting with bodyLimit only.

The new option is implemented in generated code rather than in the service definition model. That keeps the feature simple and scoped to the JavaScript/Fastify generator for now. If this pattern proves useful across other generators, such as C#, we could consider promoting it into the shared service definition model later.

What Changed

  • Added routeOptions to generated Fastify plugin options.
  • Limited routeOptions to bodyLimit only.
  • Supported both:
    • '*' for a default body limit across all routes
    • per-route overrides that take precedence over the default
  • Updated the generator to emit explicit bodyLimit assignment for each route.

@mitchknife mitchknife merged commit 466a049 into master Apr 23, 2026
3 checks passed
@mitchknife mitchknife deleted the mitch/fastify-bodylimit branch April 23, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant